<?php


namespace app\user\controller;

use app\index\controller\Base;
use app\user\model\Admin as AdminModel;

class Admin extends Base
{
    public function get(){
        $data = $this->request->param();
        $res = new AdminModel();
        if(empty($data) ){
            return 'fail,未定义参数tel';
        }else{
            $map =['tel'=>$data['tel'],'password'=>$data['password']];
            return $res->get($map);
        }
    }
    public function update()
    {
        $data = $this->request->param();
        $res = new AdminModel();
        return $res->updateModel($data);
    }
    public function delete(){
        $data = $this->request->param();
        $res = new AdminModel();
        return $res->deleteModel($data);
    }
    public function save(){
        $res = new AdminModel();
        $data = $this->request->param();
        $res->saveModel($data);
    }
}